$OpenBSD: patch-makefile,v 1.4 2011/05/08 21:47:44 kili Exp $
--- makefile.orig	Sun Apr 17 16:56:56 2011
+++ makefile	Sun May  8 15:40:35 2011
@@ -1,16 +1,16 @@
 PROG = blobwars
 PAKNAME = blobwars.pak
-DOCS = doc/*
+DOCS = doc/*.{gif,png,html}
 ICONS = icons/
 DATA = data gfx sound music
 
 VERSION = 1.19
 RELEASE ?= 0
-USEPAK ?= 0
+USEPAK ?= 1
 
 PREFIX ?= /usr
-BINDIR ?= $(PREFIX)/games/
-DATADIR ?= $(PREFIX)/share/games/blobwars/
+BINDIR ?= $(PREFIX)/bin/
+DATADIR ?= $(PREFIX)/share/$(PROG)/data/
 DOCDIR ?= $(PREFIX)/share/doc/$(PROG)/
 ICONDIR ?= $(PREFIX)/share/icons/hicolor/
 DESKTOPDIR ?= $(PREFIX)/share/applications/
@@ -22,7 +22,7 @@ CXXFLAGS += `sdl-config --cflags` -DVERSION=$(VERSION)
 CXXFLAGS += -DPAKNAME=\"$(PAKNAME)\" -DPAKLOCATION=\"$(DATADIR)\" -DUNIX -DGAMEPLAYMANUAL=\"$(DOCDIR)index.html\" -Wall
 CXXFLAGS += -DLOCALEDIR=\"$(LOCALEDIR)\" -DMEDAL_SERVER_HOST=\"$(MEDAL_SERVER_HOST)\" -DMEDAL_SERVER_PORT=$(MEDAL_SERVER_PORT)
 CXXFLAGS += $(CFLAGS) -Werror
-LIBS = `sdl-config --libs` -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lz
+LIBS = `sdl-config --libs` -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lz -lintl -liconv
 
 OBJS += CAudio.o
 OBJS += CBoss.o
@@ -104,31 +104,30 @@ buildpak: $(PAKNAME)
 
 # install
 install: $(ALL)
-	mkdir -p $(DESTDIR)$(BINDIR)
-	mkdir -p $(DESTDIR)$(DATADIR)
-	mkdir -p $(DESTDIR)$(DOCDIR)
-	mkdir -p $(DESTDIR)$(ICONDIR)16x16/apps
-	mkdir -p $(DESTDIR)$(ICONDIR)32x32/apps
-	mkdir -p $(DESTDIR)$(ICONDIR)64x64/apps
-	mkdir -p $(DESTDIR)$(DESKTOPDIR)
+	$(BSD_INSTALL_PROGRAM_DIR) $(BINDIR)
+	$(BSD_INSTALL_DATA_DIR) $(DATADIR)
+	$(BSD_INSTALL_DATA_DIR) $(DOCDIR)
+	$(BSD_INSTALL_DATA_DIR) $(ICONDIR)16x16/apps
+	$(BSD_INSTALL_DATA_DIR) $(ICONDIR)32x32/apps
+	$(BSD_INSTALL_DATA_DIR) $(ICONDIR)64x64/apps
+	$(BSD_INSTALL_DATA_DIR) $(DESKTOPDIR)
 
-	install -m 755 $(PROG) $(DESTDIR)$(BINDIR)$(PROG)
+	$(BSD_INSTALL_PROGRAM) $(PROG) $(BINDIR)
 ifeq ($(USEPAK), 1)
-	install -m 644 $(PAKNAME) $(DESTDIR)$(DATADIR)$(PAKNAME)
+	$(BSD_INSTALL_DATA) $(PAKNAME) $(DATADIR)
 else
-	cp -pr $(DATA) $(DESTDIR)$(DATADIR)
+	umask 022 && cp -R $(DATA) $(DATADIR)
 endif
-	cp -p $(DOCS) $(DESTDIR)$(DOCDIR)
-	cp -p $(ICONS)$(PROG).png $(DESTDIR)$(ICONDIR)32x32/apps/
-	cp -p $(ICONS)$(PROG)-mini.png $(DESTDIR)$(ICONDIR)16x16/apps/$(PROG).png
-	cp -p $(ICONS)$(PROG)-large.png $(DESTDIR)$(ICONDIR)64x64/apps/$(PROG).png
-	cp -p $(ICONS)$(PROG).desktop $(DESTDIR)$(DESKTOPDIR)
+	$(BSD_INSTALL_DATA) $(DOCS) $(DOCDIR)
+	$(BSD_INSTALL_DATA) $(ICONS)$(PROG).png $(ICONDIR)32x32/apps
+	$(BSD_INSTALL_DATA) $(ICONS)$(PROG)-mini.png $(ICONDIR)16x16/apps/$(PROG).png
+	$(BSD_INSTALL_DATA) $(ICONS)$(PROG)-large.png $(ICONDIR)64x64/apps/$(PROG).png
+	$(BSD_INSTALL_DATA) $(ICONS)$(PROG).desktop $(DESKTOPDIR)
 
 	@for f in $(LOCALE_MO); do \
 		lang=`echo $$f | sed -e 's/^locale\///;s/\.mo$$//'`; \
-		mkdir -p $(DESTDIR)$(LOCALEDIR)$$lang/LC_MESSAGES; \
-		echo "cp $$f $(DESTDIR)$(LOCALEDIR)$$lang/LC_MESSAGES/$(PROG).mo"; \
-		cp $$f $(DESTDIR)$(LOCALEDIR)$$lang/LC_MESSAGES/$(PROG).mo; \
+		$(BSD_INSTALL_DATA_DIR) $(LOCALEDIR)$$lang/LC_MESSAGES; \
+		$(BSD_INSTALL_DATA) $$f $(LOCALEDIR)$$lang/LC_MESSAGES/$(PROG).mo; \
 	done
 
 uninstall:
